<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Web\LoginController;
use App\Http\Controllers\Web\IndexController;
use App\Http\Controllers\Web\AdminController;
use App\Http\Controllers\Web\RoleController;
use App\Http\Controllers\Web\PermissionController;
use App\Http\Controllers\Web\MenuController;
use App\Http\Controllers\Web\PosterController;
use App\Http\Controllers\Web\AdvertController;
use App\Http\Controllers\Web\OrderController;
use App\Http\Controllers\Web\FloorRoomController;
use App\Http\Controllers\Web\MemberController;
use App\Http\Controllers\Web\BaseController;
use App\Http\Controllers\Web\ConfigController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/',[IndexController::class,'index']);

Route::group(['prefix'=>'back'],function(){
    Route::post('login',[LoginController::class,'login'])->name('login');
    Route::post('loginOut',[LoginController::class,'loginOut'])->name('loginOut');
    Route::post('uploadImg',[BaseController::class,'uploadImg'])->name('uploadImg');
    Route::post('getAllBuilding',[IndexController::class,'getAllBuilding']);
    Route::post('getAllFloor',[IndexController::class,'getAllFloor']);
    Route::post('getAllRoom',[IndexController::class,'getAllRoom']);
    Route::post('deliveryData',[IndexController::class,'deliveryData']);
    Route::post('addBatch',[FloorRoomController::class,'addBatch']);
});

Route::group(['prefix'=>'back','namespace'=>'Web','middleware'=>'webAuth'],function(){
    //管理员
    Route::match(['get','post'],'getUser',[AdminController::class,'index'])->name('getUser');
    Route::post('addUser',[AdminController::class,'add'])->name('addUser');
    Route::post('getUserInfo',[AdminController::class,'getUserById'])->name('getUserInfo');
    Route::post('editUser',[AdminController::class,'edit'])->name('editUser');
    Route::post('checkStatus',[AdminController::class,'checkStatus'])->name('checkStatus');
    Route::post('delUser',[AdminController::class,'destroy'])->name('delUser');
    //角色
    Route::match(['get','post'],'getRole',[RoleController::class,'index'])->name('getRole');
    Route::post('addRole',[RoleController::class,'add'])->name('addRole');
    Route::post('getRoleInfo',[RoleController::class,'getRoleById'])->name('getRoleInfo');
    Route::post('editRole',[RoleController::class,'edit'])->name('editRole');
    Route::post('delRole',[RoleController::class,'destroy'])->name('delRole');
    //权限
    Route::match(['get','post'],'getPermission',[PermissionController::class,'index'])->name('getPermission');
    Route::post('addPermission',[PermissionController::class,'add'])->name('addPermission');
    Route::post('getPermissionInfo',[PermissionController::class,'getPermissionById'])->name('getPermissionInfo');
    Route::post('editPermission',[PermissionController::class,'edit'])->name('editPermission');
    Route::post('delPermission',[PermissionController::class,'destroy'])->name('delPermission');
    //菜单
    Route::match(['get','post'],'getMenu',[MenuController::class,'index'])->name('getMenu');
    Route::post('addMenu',[MenuController::class,'add'])->name('addMenu');
    Route::post('getMenuInfo',[MenuController::class,'getMenuById'])->name('getMenuInfo');
    Route::post('editMenu',[MenuController::class,'edit'])->name('editMenu');
    Route::post('delMenu',[MenuController::class,'destroy'])->name('delMenu');
    //海报
    Route::match(['get','post'],'getPoster',[PosterController::class,'index'])->name('getPoster');
    Route::post('addPoster',[PosterController::class,'add'])->name('addPoster');
    Route::post('getPosterInfo',[PosterController::class,'getPosterById'])->name('getPosterInfo');
    Route::post('editPoster',[PosterController::class,'edit'])->name('editPoster');
    Route::post('delPoster',[PosterController::class,'destroy'])->name('delPoster');
    //广告
    Route::match(['get','post'],'getAdvert',[AdvertController::class,'index'])->name('getAdvert');
    Route::post('addAdvert',[AdvertController::class,'add'])->name('addAdvert');
    Route::post('getAdvertInfo',[AdvertController::class,'getAdvertById'])->name('getAdvertInfo');
    Route::post('editAdvert',[AdvertController::class,'edit'])->name('editAdvert');
    Route::post('delAdvert',[AdvertController::class,'destroy'])->name('delAdvert');
    //会员
    Route::match(['get','post'],'getMember',[MemberController::class,'index'])->name('getMember');
//    Route::post('addMember',[MemberController::class,'add'])->name('addMember');
    Route::post('getMemberInfo',[MemberController::class,'getMemberById'])->name('getMemberInfo');
    Route::post('editMember',[MemberController::class,'edit'])->name('editMember');
    Route::post('delMember',[MemberController::class,'destroy'])->name('delMember');
    //楼房
    Route::match(['get','post'],'getFloorRoom',[FloorRoomController::class,'index'])->name('getFloorRoom');
    Route::post('addFloorRoom',[FloorRoomController::class,'add'])->name('addFloorRoom');
    Route::post('getFloorRoomInfo',[FloorRoomController::class,'getFloorRoomById'])->name('getFloorRoomInfo');
    Route::post('editFloorRoom',[FloorRoomController::class,'edit'])->name('editFloorRoom');
    Route::post('delFloorRoom',[FloorRoomController::class,'destroy'])->name('delFloorRoom');
    //订单
    Route::match(['get','post'],'getOrder',[OrderController::class,'index'])->name('getOrder');
//    Route::post('addOrder',[OrderController::class,'add'])->name('addOrder');
    Route::post('getOrderInfo',[OrderController::class,'getOrderById'])->name('getOrderInfo');
    Route::post('editOrder',[OrderController::class,'edit'])->name('editOrder');
    Route::post('delOrder',[OrderController::class,'destroy'])->name('delOrder');
    Route::post('delivery',[OrderController::class,'delivery'])->name('delivery');
    Route::post('orderRefund',[OrderController::class,'orderRefund'])->name('orderRefund');
    
    //配置
    Route::match(['get','post'],'getConfig',[ConfigController::class,'index'])->name('getConfig');
    Route::post('getConfigInfo',[ConfigController::class,'getConfigById'])->name('getConfigInfo');
    Route::post('editConfig',[ConfigController::class,'edit'])->name('editConfig');
    //统计
    
    Route::post('getAllUser',[IndexController::class,'getAllUser']);
    
    Route::post('getStatistics',[IndexController::class,'getStatistics']);
    Route::post('getUserStatistics',[IndexController::class,'getUserStatistics']);


});
